import cv2
import numpy as np

img = cv2.imread('E:\\112.png')

#索贝尔算子Y方向边缘
dst1 = cv2.Sobel(img,cv2.CV_64F,1,0)

#索贝尔算子X方向边缘
dst2 = cv2.Sobel(img,cv2.CV_64F,0,1)

#两个方向进行合并
dst3 = dst1 + dst2

#拉普拉斯算子
dst4 = cv2.Laplacian(img, cv2.CV_64F,ksize=5)

# cv2.imshow('img',img)
# cv2.imshow('dst1',dst1)
# cv2.imshow('dst2',dst2)
# cv2.imshow('dst3',dst3)
cv2.imshow('dst4',dst4)
cv2.waitKey(0)